package pojo;

import java.util.Collection;
import java.util.Objects;

public class TbAddress {
    private Integer addressId;
    private String contactAddress;
    private String userTel;
    private String userName;
    private String detailAddress;
    private Integer userId;
    private Collection<TbOrder> tbOrdersByAddressId;

    public Integer getAddressId() {
        return addressId;
    }

    public void setAddressId(Integer addressId) {
        this.addressId = addressId;
    }

    public String getContactAddress() {
        return contactAddress;
    }

    public void setContactAddress(String contactAddress) {
        this.contactAddress = contactAddress;
    }

    public String getUserTel() {
        return userTel;
    }

    public void setUserTel(String userTel) {
        this.userTel = userTel;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getDetailAddress() {
        return detailAddress;
    }

    public void setDetailAddress(String detailAddress) {
        this.detailAddress = detailAddress;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbAddress tbAddress = (TbAddress) o;
        return Objects.equals(addressId, tbAddress.addressId) &&
                Objects.equals(contactAddress, tbAddress.contactAddress) &&
                Objects.equals(userTel, tbAddress.userTel) &&
                Objects.equals(userName, tbAddress.userName) &&
                Objects.equals(detailAddress, tbAddress.detailAddress) &&
                Objects.equals(userId, tbAddress.userId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(addressId, contactAddress, userTel, userName, detailAddress, userId);
    }

    public Collection<TbOrder> getTbOrdersByAddressId() {
        return tbOrdersByAddressId;
    }

    public void setTbOrdersByAddressId(Collection<TbOrder> tbOrdersByAddressId) {
        this.tbOrdersByAddressId = tbOrdersByAddressId;
    }
}
